<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" href="../../css/mui.min.css" />
		<title></title>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-back  mui-icon-backmui-pull-left"></a>
			<h1 class="mui-title">意见反馈</h1>
		</header>
		<!--主体内容-->
		<div class="mui-content">
			<div class="row mui-input-row">
				<textarea id='question' class="mui-input-clear question" placeholder="请您详细描述恁的问题和意见..." style="height: 150px;"></textarea>
			</div>
		</div>
		<p>微信/QQ/邮箱</p>
		<div class="mui-input-row">
			<input id='contact' type="text" class="mui-input-clear  contact" placeholder="(我们联系你 )" />
		</div>
		<div class="mui-row">
			<div class="mui-col-sm-3 mui-col-xs-3"></div>
			<div class="mui-col-sm-3 mui-col-xs-3">
				<button id='people' type="button" class="mui-btn mui-btn-danger">人工反馈</button>
			</div>
			<div class="mui-col-sm-3 mui-col-xs-3">
				<button id='online' type="button" class="mui-btn mui-btn-green">在线提交</button>
			</div>
		</div>
		<p align="center" style="margin-top: 20px;">您对我们的反馈的意见，我们都会积极改进</p>
		</div>
	</body>
	<script src="../../js/mui.min.js"></script>
	<script src="../../js/myjs/localVarchar.js"></script>
	<script src="../../js/ipjs/ip.js"></script>
	<script src="../../js/constatnt/var.js"></script>
	<script type="text/javascript">
		document.getElementById("people").addEventListener('tap', function() {
			mui.openWindow({
				url: "../humanServices/human.html"
			});
		});
		document.getElementById("online").addEventListener('tap', function() {
			//获取地址信息
			var feedback = {
				content: document.getElementById("question").value,
				contact: document.getElementById("contact").value,
				phone: localStorage.getItem(LOCAL_USER_INFO)
			};
			var falg = true;
			if(feedback.content == "" && feedback.contact == "") {
				falg = false;
			}
			if(falg) {
				//在线提交
				mui.ajax(ip + '/getFeedback', {
					data: JSON.stringify(feedback),
					dataType: 'json', //服务器返回json格式数据
					type: 'post', //HTTP请求类型
					timeout: 10000, //超时时间设置为10秒；
					headers: {
						'Content-Type': 'application/json'
					},
					success: function(data) {
						//服务器返回响应，根据响应结果，分析是否登录成功；
						if(OPERATION_SUCCESS == data.data.code) {
							mui.toast(data.data.msg);
						}
					},
					error: function(xhr, type, errorThrown) {
						//异常处理；
						mui.toast("系统异常！");
					}
				});
			}else{
				alert("请您完善信息");
			}
		});
	</script>

</html>